package model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the PRODUCT_LINE database table.
 * 
 */
@Entity
@Table(name="PRODUCT_LINE")
public class ProductLine implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="PRODUCT_LINE_ID")
	private long productLineId;

	@Column(name="PRODUCT_LINE_NAME")
	private String productLineName;

	//bi-directional many-to-one association to Product
	@OneToMany(mappedBy="productLine")
	private List<Product> products;

	public ProductLine() {
	}

	public long getProductLineId() {
		return this.productLineId;
	}

	public void setProductLineId(long productLineId) {
		this.productLineId = productLineId;
	}

	public String getProductLineName() {
		return this.productLineName;
	}

	public void setProductLineName(String productLineName) {
		this.productLineName = productLineName;
	}

	public List<Product> getProducts() {
		return this.products;
	}

	public void setProducts(List<Product> products) {
		this.products = products;
	}

	
	public Product addProducts(Product products) {
		getProducts().add(products);
		products.setProductLine(this);

		return products;
	}

	public Product removeProducts(Product products) {
		getProducts().remove(products);
		products.setProductLine(null);

		return products;
	}
}